﻿
using System;
using System.Collections.Generic;
using System.Text;

using YouHP.Utility;
using YouHP.BLL;
using YouHP.Model;
using YouHP.Logic;

namespace YouHP.Pages.TreatmentHistory
{
    public class HistoryStart : PatientBasePage
    {
        protected TreatmentHistoryLogic trmHisLogic = new TreatmentHistoryLogic();
        protected int StartCurrent = 1;
        protected override void ShowPage()
        {
            base.ShowPage();
            if (ErrorCount > 0) return;

            HandleCommon();
            if (ErrorCount > 0) return;

            if (IsPost) HandlePost();
            else HandleGet();
        }

        protected TreatmentHistoryInfo TrmHistoryData;
        protected TreatmentInfo TrmData;

        protected int bCurrentInfo = 0;

        protected new void HandleCommon()
        {
            StartCurrent = RequestTools.GetInt("cur", 1);
            int trmid = RequestTools.GetInt("trmid", 0);
            if(trmid <= 0)
            {
                ErrMsg= "参数错误！";
                ErrorCount = 1;
                return;
            }
            TrmData = TreatmentBLL.Instance.GetTreatmentInfo(trmid);
            if (TrmData.Id <= 0)
            {
                ErrMsg= "参数错误！";
                ErrorCount = 1;
                return;
            }
        }

        protected new void HandlePost()
        {
    
        }

        protected new void HandleGet()
        {
            TrmHistoryData = trmHisLogic.GetCurrentTreatment(PrData.Id, TrmData.Id);
        }

        protected TreatmentHistoryInfo ValidateForm()
        {
            TreatmentHistoryInfo info = new TreatmentHistoryInfo();


            return info;
        }
    }
}